import api from '../index';
import urls from './urls';

const header = {};

export default {
    list(id) {
        // return出去了一个promise
        return api.get(urls.list + '/' + id + '/list', null, null);
    },
    add(data) {
        return api.post(urls.add, data, null, null);
    },
    update(data) {
        return api.post(urls.update, data, null, null);
    },

    listByCompany(subjectid, companyname) {
        return api.get(urls.conlist + `/${subjectid}/${companyname}/list`, null, null);
    },

    listBySubject(subjectid) {
        return api.get(urls.listBySubject + `/${subjectid}/list`, null, null);
    },

    isProjectIdExist(id) {
        return api.post(urls.isProjectIdExist + '?projectId=' + id, null, null, null);
    },

    queryTenders(subjectId) {
        return api.post(urls.queryTenders, subjectId, null, null);
    }
};